package com.platform.boot.security.user.authority;

import org.springframework.data.r2dbc.repository.R2dbcRepository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @author <a href="https://github.com/vnobo">Alex bob</a>
 */
public interface UserAuthoritiesRepository extends R2dbcRepository<UserAuthority, Integer> {

    /**
     * delete by user code
     *
     * @param userCode user code
     * @return delete count result
     */
    Mono<Integer> deleteByUserCode(String userCode);

    /**
     * get by user code
     *
     * @param userCode user code
     * @return user authorities
     */
    Flux<UserAuthority> findByUserCode(String userCode);
}